#include "stdafx.h"
#include "XAppData.h"

#include "Util/Include/FileUtil.h"


extern HMODULE g_XSkinModule;


namespace XAppData
{
    ExportXSkinLib XString GetAppPath()
    {
        XString strResult;
        TCHAR szBuffer[MAX_PATH] = {0};
        if(GetModuleFileName(NULL, szBuffer, MAX_PATH) > 0)
        {
            strResult = szBuffer;
            strResult = FileUtil::ExtractFolder(strResult.GetData());
        }
        return strResult;
    }

    // Env
    ExportXSkinLib HMODULE GetXSkinModule()
    {
#ifdef XSKIN_EXPORTS
        return g_XSkinModule;
#else // XSKIN_EXPORTS
        return ::GetModuleHandle(NULL);
#endif // XSKIN_EXPORTS
    }
}